namespace etcetera.Mvc.UI.Toolbar
{
    public abstract class ToolbarItem
    {
        protected string _actionUrl;

        public string ActionUrl
        {
            get { return _actionUrl; }
            set { _actionUrl = value; }
        }

        public IToolbar Toolbar { get; set; }

        public abstract string GetValue();

        /*
        protected string CreateImageLinkTag(string url, string linkTitle, string imageUrl, string id)
        {
            return string.Format("<a href=\"{0}\" id=\"{3}\" title=\"{1}\"><img src=\"{2}\" /></a>", url, linkTitle, imageUrl, id);
        }
        
        protected string CreateImageTag(string altImageText, string imageUrl)
        {
            return string.Format("<img alt=\"{0}\" src=\"{1}\" />", altImageText, imageUrl);
        }

        protected string CreateImageTag(string altImageText, string imageUrl, string spanId)
        {
            return string.Format("<span id='{2}'><img alt='{0}' src='{1}' /></span>", altImageText, imageUrl, spanId);
        }
        */

        protected string CreateSpanTag(string title)
        {
            // <span title="First" id="pgrMF" class="tBtnF tBtnFd"></span>
            return string.Format("<span title='{0}'/>", title);
        }

        protected string CreateSpanTag(string url, string title)
        {
            // <span title="Last" id="pgrML" class="tBtnL"><a href="page=2" id="pgrMLl" title="Next"></a></span>
            return string.Format("<a href='{0}' title='{1}'><span title='{1}'></span></a>", url, title);
        }
        
    }
}